package com.sun.radarchart;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.sun.chart.RadarChart;
import com.sun.chart.data.RadarData;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private RadarChart chart;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        chart = findViewById(R.id.chart);
        setData();
    }

    private void setData() {
        List<RadarData> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add(new RadarData((float) (Math.random() * 100), "标题" + i));
        }
        chart.setDatasWithAnim(list);
    }
}
